/**
 * 
 */
package com.eascs.crm.nsEditDetail.service.impl;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.eascs.crm.nsEditDetail.dao.MainPsInfoDao;
import com.eascs.crm.nsEditDetail.entity.O2oMainPsInfoEntity;
import com.eascs.crm.nsEditDetail.service.IMainPsInfoService;

/**@Description:
 *               <p>
 *               实现暗访内容接口
 *               </p>
 * @author LMX
 */
@Service
public class MainPsInfoServiceImpl implements IMainPsInfoService{

	@Autowired
	MainPsInfoDao mainPsInfoDao;

	/**
	 * @Description:
	 *               <p>
	 *               根据id查询实体
	 *               </p>
	 * @author LMX
	 */
	@Override
	public O2oMainPsInfoEntity getEntityById(String id) {
		return mainPsInfoDao.getById(O2oMainPsInfoEntity.class, id);
	}

	/**
	 * @Description:
	 *               <p>
	 *                保存修改
	 *               </p>
	 * @author LMX
	 */
	@Override
	public boolean update(O2oMainPsInfoEntity info) {
		return mainPsInfoDao.updateById(info) > 0;
	}

	/**
	 * @Description:
	 *               <p>
	 *                新增
	 *               </p>
	 * @author LMX
	 */
	@Override
	public boolean insert(O2oMainPsInfoEntity info) {
		return mainPsInfoDao.insert(info) > 0;
	}

	/**@Description:
	 *               <p>
	 *               根据loanapplyNo查询
	 *               </p>
	 * @author LMX
	 */
	@Override
	public O2oMainPsInfoEntity getByLoanNo(String loanapplyNo) {
		String sql = "SELECT * from o2o_main_ps_info t where t.loanapply_no = ?";
		return mainPsInfoDao.findEntity(sql, O2oMainPsInfoEntity.class, loanapplyNo);
	}

}
